import request from '@/utils/request' 
const baseUrl = '/cz-system/api/v1/company/' // 公司管理

// import { updateSysCompany } from '@/api/company/index'
 
/** 
# 根据企业id获取企业详情
# GET {{baseUrl}}/company/getSysCompanyInfoById/{id}
Content-Type: {{contentType}}
Authorization:{{token}}
 */
export const getSysCompanyInfoById = (id: any) => {
  return request({
    url: baseUrl+  id,
    method: 'GET' 
  })
}
/** 
# 司认证变更

Content-Type: {{contentType}}
Authorization:{{token}}
 */
export const updateSysCompanyAuthentication = (data: any) => {
  return request({
    url: baseUrl+'updateSysCompanyAuthentication',
    method: 'post' ,
    data: data,
  })
}

/** 
# 企业注册
## POST {{baseUrl}}/company/addSysCompany
## Content-Type: {{contentType}}
## Authorization:{{token}}
 */
export const addSysCompany = (data: any) => {
  return request({
    url: baseUrl+ 'addSysCompany',
    method: 'POST',
    data: data,
  //   data:{
  //   "userId":137,
  //   "name": "河南陆陆陆国际智能科技有限公司",
  //   "mainBusiness": 5,
  //   "invoiceTaxnum": "910000601038730009",
  //   "businessLicense": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]",
  //   "foundingTime": "2024-08-15T18:21:19",
  //   "businessHours": "2024-08-15T18:21:19",
  //   "identity": "舒广亮",
  //   "identityPhoto": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"type\":1},{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"type\":2}]",
  //   "identityNo": "412723199612103492",
  //   "certificateOffice": "上海市",
  //   "startTime": "2024-08-15T18:21:19",
  //   "endTime": "2024-08-15T18:21:19",
  //   "mobile": "13217819203",
  //   "code": "1234",
  //   "userIdentityPhoto": "[{\"url\": \"http://47.122.3.254:9000/default/template/身份证正面样例.jpg\", \"name\": \"身份证正面样例.jpg\", \"type\": 1, \"originalFileName\": \"身份证正面样例.jpg\"}, {\"url\": \"http://47.122.3.254:9000/default/template/身份证反面样例.jpg\", \"name\": \"身份证反面样例.jpg\", \"type\": 2, \"originalFileName\": \"原图sync.jpg\"}]",
  //   "userIdentityNo": "412723199612103492",
  //   "userCertificateOffice": "上海市",
  //   "userStartTime": "2024-08-15T18:21:19",
  //   "userEndTime": "2024-08-15T18:21:19",
  //   "userMobile": "13217819302",
  //   "userCode": "123456",
  //   "nickName": "舒舒舒",
  //   "passWord": "Shu_12345678",
  //   "verifyPassWord": "Shu_12345678"
  //  }
  })
}

/** 
### 修改企业信息
## PUT  {{baseUrl}}/company/updateSysCompany
 */
export const updateSysCompany = (data: any) => {
  return request({
    url: baseUrl+  'updateSysCompany',
    method: 'PUT',
    data: data,
//     data:{
//     "id": 6,
//     "name": "测试公司",
//     "businessLicense": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]",
//     "identityPhoto": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"type\":1},{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"type\":2}]",
//     "companyLogo": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]",
//     "publicizePhoto": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]",
//     "productPhoto": "[{\"name\":\"20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\",\"originalFileName\":\"原图sync.jpg\",\"url\":\"http://47.122.3.254:9000/default/20240712/324ec5ab3da2443b934eb9bc596990d1.jpg\"}]",
//     "publicizeIntroduce": "企业介绍",
//     "bank": "中国工商银行",
//     "rmbAccount": "123456789012345678",
//     "usdAccount": "123456789012345678",
//     "swiftCode": "CNCB",
//     "email": "123456789@qq.com",
//     "contacts": "张三",
//     "tel": "13217819203",
//     "location": "上海市",
//     "detailedAddress": "上海市静安区恒创国际5楼"
//  }
  })
}

/** 
## 企业注册 身份证识别
## POST {{baseUrl}}/company/ocrIDCard 
 */
export const ocrIDCard = (data: any) => {
  return request({
    url: baseUrl+ 'ocrIDCard',
    method: 'POST',
    data:data
    // data:    {
    //     "isFile":"http://47.122.3.254:9000/default/template/身份证正面国徽面图片.jpg"
    //     "theFile":"http://47.122.3.254:9000/default/template/身份证反面信息面图片.jpg"
    // }
  })
}

/** 
## 企业注册 营业执照识别
## POST {{baseUrl}}/company/ocrLicense
## Authorization:{{token}}
## Content-Type: {{contentType}}
 */
export const ocrLicense = (data: any) => {
  return request({
    url: baseUrl+  'ocrLicense',
    method: 'POST',
    data: data,
    // data:{
    //     "imgFile":"C:/Users/Administrator/Desktop/jpg/营业执照.jpg"
    // }
  })
}

/** 
## 公司实名认证更新审核状态
PUT  {{baseUrl}}/company/updateSysCompanyExamineStatus
Content-Type: {{contentType}}
Authorization:{{token}}
 */
export const updateSysCompanyExamineStatus = (data: any) => {
  return request({
    url: baseUrl+  'updateSysCompanyExamineStatus',
    method: 'PUT',
    data: data,
    // data:{
    //  "id": 6,
    //  "examineStatus": 10,
    //  "reasonRejection": "驳回原因"
    // }
  })
}

/** 
#企业注册 营业执照一致性进行检查校验
POST {{baseUrl}}/company/ocrLicenseVerify
Authorization:{{token}}
Content-Type: {{contentType}}
 */
export const ocrLicenseVerify = (data: any) => {
  return request({
    url: baseUrl+  'ocrLicenseVerify',
    method: 'POST',
    data: data,
    // data:{
    // "name":"河南亚航国际货运代理有限公司",
    // "orgCode":"91410105671693661Y",
    // "legalRepName":"武金磊"
    // }
  })
}

/** 
#企业注册 对个人姓名和个人证件号的一致性进行检查校验
POST {{baseUrl}}/company/ocrIDCardVerify
Authorization:{{token}}
Content-Type: {{contentType}}
 */
export const ocrIDCardVerify = (data: any) => {
  return request({
    url: baseUrl+  'ocrIDCardVerify',
    method: 'POST',
    data: data,
    // data:{
    //     "idNo":"412723198701234567",
    //     "name":"张三"
    // }
  })
}

// ### E签宝认证授权
export const eSignAuth = (data: any) => {
  return request({
    url: '/cz-rentbox/api/v1/eqbCompanyAuthorizes/getEqbCompanyAuthorizeAuthShortUrl',
    method: 'POST',
    data: data,
  })
}

// 认证记录\
export const authInfoList = (data: any) => {
  return request({
    url: '/cz-system/api/v1/companyAuthenticationInfo/getSysCompanyAuthenticationInfoList',
    method: 'POST',
    data: data,
  })
}